import request from "@/utils/request";

// 一个轮播图类型
export interface IBanner {
  alt: string;
  bannerid: string;
  flag: boolean;
  img: string;
  link: string;
}
// 一个商品类型
export interface IProduct {
  proid: string;
  proname: string;
  originprice: number;
  img1: string;
  img2: string;
  img3: string;
  img4: string;
  banners: string[];
  category?: string;
}

// 获取轮播图列表
export function getBannerList() {
  return request({
    url: "/api/banner/list",
    method: "GET",
  });
}

// 获取商品列表数据
// page 请求页数
// pageSize 每页条数
export function getProductList(page: number = 1, pageSize: number = 10) {
  return request({
    url: "/api/pro/list",
    method: "GET",
    params: {
      count: page,
      limitNum: pageSize,
    },
  });
}

// 获取秒杀列表
export function getSeckillList() {
  return request({
    url: "/api/pro/seckilllist",
    method: "GET",
  });
}
